import request from '@/utils/request'

// 查询生产退料列表
export function listIssue(query) {
  return request({
    url: '/issue/issue/list',
    method: 'get',
    params: query
  })
}

// 查询生产退料详细
export function getIssue(rtId) {
  return request({
    url: '/issue/issue/' + rtId,
    method: 'get'
  })
}

// 新增生产退料
export function addIssue(data) {
  return request({
    url: '/issue/issue',
    method: 'post',
    data: data
  })
}

// 修改生产退料
export function updateIssue(data) {
  return request({
    url: '/issue/issue',
    method: 'put',
    data: data
  })
}

// 删除生产退料
export function delIssue(rtId) {
  return request({
    url: '/issue/issue/' + rtId,
    method: 'delete'
  })
}
//查询仓库
export function cang() {
  return request({
    url: '/issue/issue/cangku' ,
    method: 'get'
  })
}
//根据id查询仓库数据
export function cang1(id) {
  return request.get('/issue/issue/cangku1',{params: { id: id }})
}
//根据id查询仓库数据
export function qu(id) {
  return request.get('/issue/issue/qu',{params: { id: id }})
}
//根据id查询仓库数据
export function wei(id) {
  return request.get('/issue/issue/wei',{params: { id: id }})
}
// 前端 deleteLine 接口调用（改为请求体传数组）
export function deleteLine(issueIds) {
  return request({
    url: '/line/line/deleLine',
    method: 'post',
    data: issueIds // 直接传数组，后端用 @RequestBody 接收
  });
}